//varying out vec4 eye_position;
attribute float sphere_radius;
attribute vec4 sphere_color;
varying vec4 sphere_diffuse_color;
void main()
{
  sphere_diffuse_color=sphere_color;
  gl_TexCoord[0] = gl_MultiTexCoord0;
  vec2 tex=gl_TexCoord[0].xy;
  // Output vertex position
  gl_Position = gl_ModelViewMatrix * gl_Vertex;
  //eye_position=gl_Position;
  if(tex==vec2(0.0,0.0)){
      gl_Position.xy=gl_Position.xy+vec2(-sphere_radius,-sphere_radius);
  } else if(tex==vec2(1.0,0.0)){
    gl_Position.xy=gl_Position.xy+vec2(sphere_radius,-sphere_radius);
  } else if(tex==vec2(1.0,1.0)){
    gl_Position.xy=gl_Position.xy+vec2(sphere_radius,sphere_radius);
  } else if(tex==vec2(0.0,1.0)){
    gl_Position.xy=gl_Position.xy+vec2(-sphere_radius,sphere_radius);
  }
  gl_Position=gl_Position*gl_ProjectionMatrix;
}
